package com.sonicboom.nurun;

import com.bazaarvoice.dropwizard.assets.AssetsBundleConfiguration;
import com.bazaarvoice.dropwizard.assets.AssetsConfiguration;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.dropwizard.Configuration;
import io.dropwizard.db.DataSourceFactory;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

public class AppConfig extends Configuration  implements AssetsBundleConfiguration {
    @Valid
    @NotNull
    @JsonProperty("database")
    private DataSourceFactory database = new DataSourceFactory();

    @Valid
    @NotNull
    @JsonProperty("wechatUrl")
    private String wechatUrl;

    @Valid
    @NotNull
    @JsonProperty("axicomAddress")
    private String axicomAddress;

    @Valid
    @NotNull
    @JsonProperty("sourceId")
    private String sourceId;


    @Valid
    @NotNull
    @JsonProperty
    private final AssetsConfiguration assets = new AssetsConfiguration();

    public DataSourceFactory getDataSourceFactory() {
        return database;
    }


    public String getWechatUrl() {
        return wechatUrl;
    }

    public String getAxicomAddress() {
        return axicomAddress;
    }

    public String getSourceId() {
        return sourceId;
    }


    @Override
    public AssetsConfiguration getAssetsConfiguration() {
        return assets;
    }
}
